﻿using System;
using Common.Exceptional.Routing;

namespace Common.Configuration
{
    public class FluentConfiguration
    {
        public static void UseExceptionPipeline<T>() where T : IExceptionPipeline
        {
            if (configuration == null)
                throw new ArgumentNullException("configuration");
            /*生命周期与容器的生命周期保持一致，故而实现了单例*/
            configuration.ComponentContainer.Use<IExceptionPipeline, T>(new ContainerControlledLifetimeManager());
            return configuration;
        }
    }
}